package com.ruoyi.wbs.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wbs.mapper.ContractorMapper;
import com.ruoyi.wbs.domain.Contractor;
import com.ruoyi.wbs.service.IContractorService;

/**
 * 承包商Service业务层处理
 * 
 * @author zhaogang
 * @date 2024-07-28
 */
@Service
public class ContractorServiceImpl implements IContractorService 
{
    @Autowired
    private ContractorMapper contractorMapper;

    /**
     * 查询承包商
     * 
     * @param contractorId 承包商主键
     * @return 承包商
     */
    @Override
    public Contractor selectContractorByContractorId(Long contractorId)
    {
        return contractorMapper.selectContractorByContractorId(contractorId);
    }

    /**
     * 查询承包商列表
     * 
     * @param contractor 承包商
     * @return 承包商
     */
    @Override
    public List<Contractor> selectContractorList(Contractor contractor)
    {
        return contractorMapper.selectContractorList(contractor);
    }

    /**
     * 新增承包商
     * 
     * @param contractor 承包商
     * @return 结果
     */
    @Override
    public int insertContractor(Contractor contractor)
    {
        return contractorMapper.insertContractor(contractor);
    }

    /**
     * 修改承包商
     * 
     * @param contractor 承包商
     * @return 结果
     */
    @Override
    public int updateContractor(Contractor contractor)
    {
        return contractorMapper.updateContractor(contractor);
    }

    /**
     * 批量删除承包商
     * 
     * @param contractorIds 需要删除的承包商主键
     * @return 结果
     */
    @Override
    public int deleteContractorByContractorIds(Long[] contractorIds)
    {
        return contractorMapper.deleteContractorByContractorIds(contractorIds);
    }

    /**
     * 删除承包商信息
     * 
     * @param contractorId 承包商主键
     * @return 结果
     */
    @Override
    public int deleteContractorByContractorId(Long contractorId)
    {
        return contractorMapper.deleteContractorByContractorId(contractorId);
    }

    @Override
    public List<Map<String, Object>> list(Long projectId) {
        return contractorMapper.queryList(projectId);
    }


}
